﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="XiaLastorm.Sharpshooter.Client.ChatWindow"
	xmlns:color="clr-namespace:ColorPickerControl;assembly=ColorPickerControl"
	x:Name="Window"	
	Width="640" Height="480" Background="#FF27466E"
	WindowStyle="None"
	AllowsTransparency="True"
	MouseLeftButtonDown="Window_MouseLeftButtonDown">

	<Grid x:Name="LayoutRoot" Margin="10">
		<Grid>
			<Grid.RowDefinitions>
				<RowDefinition Height="25"/>
				<RowDefinition Height="2*"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<TextBlock Grid.Row="0" Text="{Binding ElementName=Window, Path=ChatTo, StringFormat=与{0}聊天中}" Foreground="White"></TextBlock>
			<RichTextBox x:Name="RtbChatLog" Margin="5,0,5,0" Grid.Row="1" IsReadOnly="True" Background="#f0f0f0" VerticalScrollBarVisibility="Visible">
				<FlowDocument LineHeight="5"/>
			</RichTextBox>
			<GridSplitter Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="5" Background="{Binding Background, ElementName=Window}"/>
			<Grid Grid.Row="3">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Height="24" Margin="5,0,5,0">
					<ComboBox x:Name="CbFontFamily" Width="200" Margin="5,0,5,0"/>
					<Slider x:Name="SldFontSize" Width="100" Margin="5,0,5,0" Minimum="8" Maximum="72"/>
					<Button x:Name="BtnInsertPicture" Style="{StaticResource ButtonStyle}" Margin="5,0,5,0" Width="80" Height="20" >插入图片</Button>
					<Grid Margin="5,0,5,0" >
						<Button x:Name="BtnChooseColor" Style="{StaticResource ButtonStyle}" Width="80" Height="20" Margin="0">
							<Button.Triggers>
								<EventTrigger RoutedEvent="ButtonBase.Click">
									<BeginStoryboard>
										<Storyboard>
											<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PupColorPicker" Storyboard.TargetProperty="IsOpen">
												<DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
											</BooleanAnimationUsingKeyFrames>
										</Storyboard>
									</BeginStoryboard>
								</EventTrigger>
							</Button.Triggers>
							选择颜色
						</Button>
						<Popup x:Name="PupColorPicker" >
							<Popup.Triggers>
								<EventTrigger RoutedEvent="MouseLeave">
									<BeginStoryboard>
										<Storyboard>
											<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen">
												<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
											</BooleanAnimationUsingKeyFrames>
										</Storyboard>
									</BeginStoryboard>
								</EventTrigger>
							</Popup.Triggers>
							<color:ColorPicker x:Name="ClPicker" Background="White" Width="500"/>
						</Popup>
					</Grid>
				</StackPanel>
				<RichTextBox Grid.Row="1" x:Name="RtbInput" Background="#f1f3f8" VerticalScrollBarVisibility="Auto" Margin="5,5,0,5">
					<FlowDocument LineHeight="5"/>
				</RichTextBox>
				<Button x:Name="BtnSend" Style="{StaticResource ButtonStyle}" Grid.Row="1" Grid.Column="1" Width="80" Height="80" Margin="15,0,5,0">发送</Button>
			</Grid>
		</Grid>
		<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
			<Button Style="{StaticResource MiniButtonStyle}" Click="Button_Click_2"  HorizontalAlignment="Right" VerticalAlignment="Top" Width="15" Height="15" Margin="5,0,5,0"/>
			<Button Style="{StaticResource CloseButtonStyle}" Click="Button_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Width="15" Height="15" Margin="5,0,5,0"/>
		</StackPanel>
	</Grid>
</Window>